package com.guigu.qingcheng.service;

import com.guigu.qingcheng.utils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import com.guigu.qingcheng.pojo.TbOrder;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

/**
 * 远程调用goods
 */
@FeignClient("service-order")
@Component
public interface OrderServiceFeign {

    /**
     * 远程调用查询我的订单方法
     * @param username
     * @param pageNum
     * @param pageSize
     * @return
     */
    @GetMapping("/order/order/queryOrderItemSkuByUsername/{pageNum}/{pageSize}/{orderStatus}")
    R queryOrderItemSkuByUsername(@RequestParam String username,@PathVariable("pageNum") Integer pageNum
            , @PathVariable("pageSize") Integer pageSize,@PathVariable("orderStatus") Integer orderStatus);

    @ApiOperation(value = "根据id获取信息")
    @GetMapping("/order/order/detail/{id}")
    R detail(@PathVariable("id") String id);

    @ApiOperation(value = "通过订单Id 获取到 订单、订单明细、商品表 三表查询 的数据")
    @GetMapping("/order/order/queryOrderItemSkuByOrderId/{id}")
    R queryOrderItemSkuByOrderId(@PathVariable String id);


    //获取地址
    @GetMapping("/order/order/queryChenShi")
    public R queryChenShi();

    //根据省份id获取市
    @GetMapping("/order/order/queryShiById/{id}")
    public R queryShiById(@PathVariable("id") String id);

    //根据市id查询区列表
    @GetMapping("/order/order/queryByQuId/{id}")
    public R queryByQuId(@PathVariable("id") String id);
    @PostMapping("/order/preferential/findPreMoneyByCategoryId")
    public R findPreMoneyByCategoryId(@RequestParam Integer categoryId,@RequestParam int money);

    @PostMapping("/order/order/addOrder")
    public Map<String,Object> addOrder(@RequestBody TbOrder tbOrder);

    @PostMapping("/order/wxxpay/createNative")
    public Map createNative(@RequestParam String orderId,@RequestParam String username);

    @PostMapping("/order/wxxpay/notifyLogic")
    public void notifyLogic(@RequestParam String xml);

    @GetMapping("/order/okOrder/{id}")
    R okOrder(@PathVariable String id);

    /**
     * 商品热买
     * @return
     */
    @GetMapping("/order/order/item/host")
    public R findHost();

    /**
     * 特价商品
     * @return
     */
    @GetMapping("/order/order/item/price")
    public R lessPrice();

    /**
     * 新品排行
     * @return
     */
    @GetMapping("/order/order/item/commodities")
    public R commodities();

}
